home *** CD-ROM | disk | FTP | other *** search
/ Sports Illustrated for Kids - Awesome Athletes! / Sports Illustrated for Kids - Awesome Athletes!.iso / hf.dir / 00345_Ticket.ls < prev    next >
Encoding:
Text File  |  1996-04-19  |  2.6 KB  |  102 lines

  1. global gHFAthleteMode, gHFlastTicket, gHFposition, gHFaList, gHFsList, gHFaMax, gHFsMax, ghfmaxathleteno, ghfathlete, gHFsaveAthleteMode
  2.  
  3. on whichTicket aPoint
  4.   if inside(aPoint, rect(360, -6, 466, 69)) then
  5.     set vRet to "_R"
  6.   else
  7.     if inside(aPoint, rect(465, -6, 599, 69)) then
  8.       set vRet to "_B"
  9.     else
  10.       set vRet to EMPTY
  11.     end if
  12.   end if
  13.   return vRet
  14. end
  15.  
  16. on ticketClick
  17.   set gHFsaveAthleteMode to gHFAthleteMode
  18.   set vSprite to the clickOn
  19.   set vSave to the castNum of sprite vSprite
  20.   set vPoint to point(the mouseH, the mouseV)
  21.   set vTicket to whichTicket(vPoint)
  22.   if gHFAthleteMode then
  23.     set vMode to "_A"
  24.   else
  25.     set vMode to "_S"
  26.   end if
  27.   if the number of cast ("CLICK" & vMode & vTicket) < 1 then
  28.     exit
  29.   end if
  30.   set the castNum of sprite vSprite to cast ("CLICK" & vMode & vTicket)
  31.   updateStage()
  32.   repeat while the stillDown
  33.     nothing()
  34.   end repeat
  35.   set vPoint to point(the mouseH, the mouseV)
  36.   if vTicket = whichTicket(vPoint) then
  37.     if vTicket = "_B" then
  38.       SetCursor(#wait)
  39.       dontPassEvent()
  40.       setAthleteMode(1)
  41.       puppetSound("pheeu.aif")
  42.       go("listmenu")
  43.       put EMPTY before line 1 of field "athletelist"
  44.       SetCursor(#normal)
  45.     else
  46.       SetCursor(#wait)
  47.       dontPassEvent()
  48.       setAthleteMode(0)
  49.       puppetSound("pheeu.aif")
  50.       if gHFsMax = 0 then
  51.         set the text of cast "searchlist" to "*No Search Results*"
  52.       else
  53.         set the text of cast "searchlist" to the text of cast "Result List"
  54.         put EMPTY before line 1 of field "searchlist"
  55.       end if
  56.       go("searchmenu")
  57.       SetCursor(#normal)
  58.     end if
  59.   else
  60.     set the castNum of sprite vSprite to vSave
  61.     updateStage()
  62.   end if
  63. end
  64.  
  65. on ticketRollover
  66.   if gHFAthleteMode then
  67.     set vMode to "_A"
  68.   else
  69.     set vMode to "_S"
  70.   end if
  71.   set vPoint to point(the mouseH, the mouseV)
  72.   set vTicket to whichTicket(vPoint)
  73.   if rollOver(16) then
  74.     set vState to "ROLL"
  75.   else
  76.     set vState to "NORM"
  77.   end if
  78.   set vCast to the number of cast (vState & vMode & vTicket)
  79.   set the castNum of sprite 16 to vCast
  80.   updateStage()
  81. end
  82.  
  83. on setAthleteMode aFlag, aForce
  84.   if voidp(aForce) then
  85.     set aForce to 0
  86.   end if
  87.   if (aFlag = gHFAthleteMode) and not aForce then
  88.     exit
  89.   end if
  90.   set gHFAthleteMode to aFlag
  91.   if aFlag then
  92.     set ghfmaxathleteno to gHFaMax
  93.     set ghfathlete to value(string(gHFaList))
  94.     set vCast to the number of cast "NORM_A"
  95.   else
  96.     set ghfmaxathleteno to gHFsMax
  97.     set ghfathlete to value(string(gHFsList))
  98.     set vCast to the number of cast "NORM_S"
  99.   end if
  100.   set the castNum of sprite 16 to vCast
  101. end
  102.